/**
 * 获取验证码
 */
import { ISystemCaptcha, ISystemLog, IWebsite } from '@/api/system/type';
import { http } from '@/core/http';

export const getSystemCaptcha = () => {
  return http.get<ISystemCaptcha.Data>({
    url: 'system/captcha',
    isLoading: false
  });
};

/**
 * 站点配置
 */
export const getSystemWebsite = () => {
  return http.get<IWebsite.Data>({
    url: 'system/website',
    isLoading: false
  });
};
/**
 * 更新网站配置
 */
export const websiteConfigPost = (data: {
    Id: number;
    isCode?: number;
    isRegistryCode?: number;
    isRegistry?: number;
    websiteTitle?: string;
    websiteLogo?: string;
    websiteIcp?: string;
    websiteCover?: string;
    websiteColor?: string;
}) => {
  return http.put({
    url: '/system/update/website',
    data,
    isShowSuccessText: true
  });
};
/**
 * 系统日志
 */

export const getSystemLog = (params?: {
    pageSize?: number;
    pageNum?: number;
}) => {
  return http.get<ISystemLog.Data>({
    url: '/system/log-list',
    isLoading: false,
    params
  });
};
